<%@page import="db_interaction.Notificacao"%>
<%@page import="db_interaction.Amigos"%>
<%@page import="Others.seachUsers"%>
<%
    if (session.isNew()) {
        response.sendRedirect("/TheHive/login/index.jsp");
    }
%>

<div class="mainbar">


    <%
        Notificacao insert_notification = new Notificacao();
        String email_user_login = (String) session.getAttribute("email");
        String email_user_amigo = request.getParameter("viewprofileEmail2");
        Amigos amigo = new Amigos();
        int res_add_friend;
        Boolean res_insert_notification = false;


        res_add_friend = amigo.AddFriend(email_user_login, email_user_amigo);


        // -------------- CRIAR NOTIFICACAO ----------------

        res_insert_notification = insert_notification.InsertNotification(email_user_amigo,res_add_friend);


        if (res_insert_notification) {

            response.sendRedirect("/TheHive/publications/index.jsp");

        } else {
        }
    %>

</div>